<!doctype html>
<html lang="en-us">
  <head>
    <title>BeginingOfHugo // Andy的个人博客</title>
    <meta charset="utf-8" />
    <meta name="generator" content="Hugo 0.64.1" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="author" content="Andy Dennis" />
    <meta name="description" content="" />
    <link rel="stylesheet" href="https://chen_shu_ming.gitee.io/myblogu/css/main.min.61bb32028587f24ca28522d8d197970c7ef33284e5fffb45a75fcbbb2dbc4dcb.css" />

    
    <meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="BeginingOfHugo"/>
<meta name="twitter:description" content="windows系统的用户去 hugo二进制文件和tar包,
如果你的电脑是64位的话,推荐extends那个，记得那个比普通版的hugo支持将sass和less转为css。
然后把环境变量设置在解压出来的hugo.exe目录下。
mac用户直接在你要新建blog项目的目录下
$ brew install hugo
linux用户用adt-get，yum等，根据不同系统不同选择进行下载。
Quick Start
Create a new post
$ hugo new site myBlog
此时会自动在当前目录下生成myBlog的文件,里面有各种各样的文件，
如 archetypes, content, layouts, static, config.toml"/>

    <meta property="og:title" content="BeginingOfHugo" />
<meta property="og:description" content="windows系统的用户去 hugo二进制文件和tar包,
如果你的电脑是64位的话,推荐extends那个，记得那个比普通版的hugo支持将sass和less转为css。
然后把环境变量设置在解压出来的hugo.exe目录下。
mac用户直接在你要新建blog项目的目录下
$ brew install hugo
linux用户用adt-get，yum等，根据不同系统不同选择进行下载。
Quick Start
Create a new post
$ hugo new site myBlog
此时会自动在当前目录下生成myBlog的文件,里面有各种各样的文件，
如 archetypes, content, layouts, static, config.toml" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://chen_shu_ming.gitee.io/myblogu/post/beginingofhugo/" />
<meta property="article:published_time" content="2020-02-18T15:18:22+08:00" />
<meta property="article:modified_time" content="2020-02-18T15:18:22+08:00" />


  </head>
  <body>
    <header class="app-header">
      <a href="https://chen_shu_ming.gitee.io/myblogu/"><img class="app-header-avatar" src="/myblogu/avatar.jpg" alt="Andy Dennis" /></a>
      <h1>Andy的个人博客</h1>
      <p>work hard for tomorrow, be excited for yesterday,but enjoy life for today</p>
      <div class="app-header-social">
        
          <a target="_blank" href="https://www.jianshu.com/u/8503237aae61" rel="noreferrer noopener"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-link">
  <path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path>
  <path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path>
</svg></a>
        
          <a target="_blank" href="https://space.bilibili.com/393312192" rel="noreferrer noopener"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-link">
  <path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path>
  <path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path>
</svg></a>
        
      </div>
    </header>
    <main class="app-container">
      
  <article class="post">
    <header class="post-header">
      <h1 class ="post-title">BeginingOfHugo</h1>
      <div class="post-meta">
        <div>
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-calendar">
  <title>calendar</title>
  <rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line>
</svg>
          Feb 18, 2020
        </div>
        <div>
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-clock">
  <title>clock</title>
  <circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline>
</svg>
          1 min read
        </div></div>
    </header>
    <div class="post-content">
      <p>windows系统的用户去 <a href="https://github.com/gohugoio/hugo/releases">hugo二进制文件和tar包</a>,
如果你的电脑是64位的话,推荐<strong>extends</strong>那个，记得那个比普通版的hugo支持将sass和less转为css。</p>
<p>然后把环境变量设置在解压出来的<strong>hugo.exe</strong>目录下。</p>
<p>mac用户直接在你要新建blog项目的目录下</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">$ brew install hugo
</code></pre></div><p>linux用户用adt-get，yum等，根据不同系统不同选择进行下载。</p>
<h2 id="quick-start">Quick Start</h2>
<h3 id="create-a-new-post">Create a new post</h3>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">$ hugo new site myBlog
</code></pre></div><p>此时会自动在当前目录下生成myBlog的文件,里面有各种各样的文件，
如 archetypes, content, layouts, static, config.toml</p>
<h3 id="download-a-theme">Download a theme</h3>
<p>你可以到 <a href="https://themes.gohugo.io/">hugo主题</a> 查看主题,再把对应主题git clone下来即可。
比如下面这个例子,我在根目录下输入下面的命令下载m10c的主题。</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">$ git clone https://github.com/vaga/hugo-theme-m10c.git themes/m10c 
</code></pre></div><p>按回车后会自动把m10c下载到theme目录下。</p>
<h3 id="run-server">Run server</h3>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">$ hugo server -t m10c --buildDrafts
</code></pre></div><p>此时会默认在 http://localhost:1313/ 开启服务器，你可以在浏览器输入这个地址访问查看效果。
这里-t指定主题，此时我用的是m10c的主题, &ndash;buildDrafts是生成屋的意思, 不必纠结。</p>
<h3 id="create-a-new-md">Create a new md</h3>
<p>新建一篇文章，比如这里我在post目录下新建一篇叫hello.md的Markdown格式文章。</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">$ hugo new post/hello.md
</code></pre></div><p>然后在content/post就可以找到hello.md挥洒你的笔墨了。</p>
<h3 id="generate-static-resource">Generate static resource</h3>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">$ hugo --theme<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;m10c&#34;</span> --baseUrl<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;https://chen_shu_ming.gitee.io/myblogu/&#34;</span> --buildDrafts
</code></pre></div><p>我这里主题是m10c,baseUrl一项填你打算部署的域名,U注意大写，&ndash;buildDrafts不要拉下。
执行成功后，会在根目录下生成public文件夹，里面是静态资源html,css,js文件等。</p>
<p>进入public目录</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">$ cd public
</code></pre></div><p>一波git操作。</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">$ git add .
$ git commit -m <span style="color:#e6db74">&#34;提交附加信息&#34;</span>
$ git remote add origin 【这里是远程仓库地址,如https://xxxxx.git】
$ git push -u origin master
</code></pre></div><p>刷新后即可，如果是选择gitee部署，记得在gitpage那部署。
如果是在github上记得仓库命名有要求。</p>
    </div>
    <div class="post-footer">
      
    </div>
  </article>

    </main>
  </body>
</html>
